

public class demo4_1
{
    private String password1;
    private String password2;
    private String name;

    /**
     * 类 demo4_1 的对象的构造函数
     */
    public demo4_1(){}
    public demo4_1(String name,String password1,String password2){
    this.name=name;
    this.password1=password1;
    this.password2=password2;
    }
    
    public void setName(String name){
    this.name=name;
    }
    
    public void setPassword1(String password1){
       this.password1=password1;
    }       
        
    public void setPassword2(String password2){
        if(password1.equals(password2)){
        System.out.println("密码再次输入正确");
        this.password2=password2;
        }else{
        System.out.println("密码再次输入不正确请重新输入");
        }
    }
    public String getName(){
        return name;
    }
    public String getPassword1(){
        return password1;
    }
    public String getPassword2(){
        return password2;
    }
    public void show(){
    System.out.println("输出用户名："+name+"输出密码："+password1+"再次输出密码："+password2+"-----输出完毕");
    }
    
    
}
